<!DOCTYPE html>
<html lang="en">
<#header />

<body>
<div class="layui-fluid">
    <div class="layui-row" style="margin-top:30px;">
        <form id="userForm" method="post" class="layui-form layui-form-pane" action="/user/doCreate.btl">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" disabled  value="${user.username}" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">真实姓名</label>
                <div class="layui-input-block">
                    <input type="text" disabled  value="${user.nickname}" required  lay-verify="required" placeholder="输入真实姓名" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">用户状态</label>
                <div class="layui-input-block">
                    <select disabled id="status" value="${user.status}" name="status" lay-search>
                        <option value="">请选择</option>
                        <option value="0">正常</option>
                        <option value="1">冻结</option>
                        <option value="2">禁止</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="userForm">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    layui.use(["element","form","jquery","layer"],function(){
        var form = layui.form;
        var element = layui.element;
        var $ = layui.$;
        var layer =layui.layer;
        form.on('submit(userForm)',function(data){
             layer.msg('返回至管理界面？', {
                        time: 0 //不自动关闭
                        ,btn: ['返回', '取消']
                        ,yes: function(index){
                            layer.close(index);
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        }
              });
            return false;
        });
        $("#status option").each(function(){
            if($(this).val()=="${user.status}"){
                $(this).attr("selected","selected");
            }
        });
        form.render("select");
    });
</script>
</body>
</html>